package ProjectTeam39.GUITest;

import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JComboBox;
import javax.swing.JTextPane;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JSplitPane;
import javax.swing.JButton;

import ProjectTeam39.Domains.UserList;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class createApptFrame extends JFrame {
	UserList ul;
	createApptFrame cframe = this;
	
	public createApptFrame(final UserList ul) {
		this.ul = ul;
		JPanel panel = new JPanel();
		getContentPane().add(panel, BorderLayout.CENTER);
		panel.setLayout(null);
		
		JComboBox comboBoxDate = new JComboBox();
		comboBoxDate.setBounds(87, 11, 84, 20);
		panel.add(comboBoxDate);
		
		JComboBox comboBox = new JComboBox();
		comboBox.setBounds(87, 71, 84, 20);
		panel.add(comboBox);
		
		JTextPane textPane = new JTextPane();
		textPane.setBounds(243, 99, 134, 86);
		panel.add(textPane);
		
		JLabel lblDate = new JLabel("Date");
		lblDate.setBounds(26, 14, 29, 14);
		panel.add(lblDate);
		
		JLabel lblDoctor = new JLabel("Doctor");
		lblDoctor.setBounds(26, 74, 51, 14);
		panel.add(lblDoctor);
		
		JLabel lblWhyAreYou = new JLabel("Why are you visiting us?");
		lblWhyAreYou.setBounds(203, 74, 146, 14);
		panel.add(lblWhyAreYou);
		
		JSplitPane splitPane = new JSplitPane();
		splitPane.setBounds(137, 203, 183, 25);
		panel.add(splitPane);
		
		JButton btnSubmit = new JButton("Submit");
		splitPane.setLeftComponent(btnSubmit);
		
		JButton btnBack = new JButton("Back");
		btnBack.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				PatientFrame pframe = new PatientFrame(ul);
				pframe.setBounds(100, 100, 450, 300);
				cframe.setVisible(false);
				pframe.setVisible(true);
				pframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			}
		});
		splitPane.setRightComponent(btnBack);
		
		JPanel panel_1 = new JPanel();
		getContentPane().add(panel_1, BorderLayout.NORTH);
		
		JLabel lblRequestAppointment = new JLabel("Request Appointment");
		lblRequestAppointment.setFont(new Font("Tahoma", Font.PLAIN, 14));
		panel_1.add(lblRequestAppointment);
	}
}
